package com.haixiaoke.saas.enterprise.account.yima;


import com.haixiaoke.saas.bill.domain.BankBranch;
import com.haixiaoke.saas.bill.service.IBankBranchService;
import com.haixiaoke.saas.common.annotation.TenantScope;
import com.haixiaoke.saas.common.core.domain.AjaxResult;
import com.haixiaoke.saas.common.core.page.TableDataInfo;
import com.haixiaoke.saas.system.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 银行支行Controller
 *
 * @author qixi
 * @date 2024-06-25
 */
@RestController
@RequestMapping("/enterprise/account/yima/bankBranch")
public class EnterpriseBankBranchController extends BaseController {
    @Autowired
    private IBankBranchService bankBranchService;

    /**
     * 查询银行支行列表
     */
    @GetMapping("/list")
    @TenantScope
    public TableDataInfo list(BankBranch bankBranch) {
        startPage();
        List<BankBranch> list = bankBranchService.selectBankBranchList(bankBranch);
        return getDataTable(list);
    }

    /**
     * 获取银行支行详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(bankBranchService.selectBankBranchById(id));
    }

}
